home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 2 / Meeting Pearls Vol. II (1995)(GTI - Schatztruhe)[!].iso / Pearls / gfx / pbm / source / jpegV5.lha / jpegV5 / src / configure < prev    next >
Text File  |  1994-12-23  |  32KB  |  1,169 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        eval "with_$package='$val'" ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *=*)
  78.        varname=`echo $arg|sed -e 's/=.*//'`
  79.        # Reject names that aren't valid shell variable names.
  80.        if test -n "`echo $varname| sed 's/[a-zA-Z0-9_]//g'`"; then
  81.          echo "configure: $varname: invalid shell variable name" >&2; exit 1
  82.        fi
  83.        val="`echo $arg|sed 's/[^=]*=//'`"
  84.        test -n "$verbose" && echo "    setting shell variable $varname to $val"
  85.        eval "$varname='$val'"
  86.        eval "export $varname" ;;
  87.  
  88.      *) ;;
  89.     esac
  90.   fi
  91. done
  92.  
  93. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  94. trap 'rm -f confdefs*' 0
  95.  
  96. # NLS nuisances.
  97. # These must not be set unconditionally because not all systems understand
  98. # e.g. LANG=C (notably SCO).
  99. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  100. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  101.  
  102. rm -f conftest* confdefs.h
  103. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  104. echo > confdefs.h
  105. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  106.  
  107. # A filename unique to this package, relative to the directory that
  108. # configure is in, which we can look for to find out if srcdir is correct.
  109. unique_file=jcmaster.c
  110.  
  111. # Find the source files, if location was not specified.
  112. if test -z "$srcdir"; then
  113.   srcdirdefaulted=yes
  114.   # Try the directory containing this script, then `..'.
  115.   prog=$0
  116.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  117.   test "X$confdir" = "X$prog" && confdir=.
  118.   srcdir=$confdir
  119.   if test ! -r $srcdir/$unique_file; then
  120.     srcdir=..
  121.   fi
  122. fi
  123. if test ! -r $srcdir/$unique_file; then
  124.   if test x$srcdirdefaulted = xyes; then
  125.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  126.   else
  127.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  128.   fi
  129.   exit 1
  130. fi
  131. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  132. # But we can't avoid them for `..', to make subdirectories work.
  133. case $srcdir in
  134.   .|/*|~*) ;;
  135.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  136. esac
  137.  
  138.  
  139. # Save the original args to write them into config.status later.
  140. configure_args="$*"
  141.  
  142.  
  143. if test -z "$CC"; then
  144.   # Extract the first word of `gcc', so it can be a program name with args.
  145.   set dummy gcc; word=$2
  146.   echo checking for $word
  147.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  148.   for dir in $PATH; do
  149.     test -z "$dir" && dir=.
  150.     if test -f $dir/$word; then
  151.       CC="gcc"
  152.       break
  153.     fi
  154.   done
  155.   IFS="$saveifs"
  156. fi
  157. test -z "$CC" && CC="cc"
  158. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  159.  
  160. # Find out if we are using GNU C, under whatever name.
  161. cat > conftest.c <<EOF
  162. #ifdef __GNUC__
  163.   yes
  164. #endif
  165. EOF
  166. ${CC-cc} -E conftest.c > conftest.out 2>&1
  167. if egrep yes conftest.out >/dev/null 2>&1; then
  168.   GCC=1 # For later tests.
  169. fi
  170. rm -f conftest*
  171.  
  172. echo checking how to run the C preprocessor
  173. if test -z "$CPP"; then
  174.   # This must be in double quotes, not single quotes, because CPP may get
  175.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  176.   # make.  It must be expanded now.
  177.   CPP="${CC-cc} -E"
  178.   cat > conftest.c <<EOF
  179. #include "confdefs.h"
  180. #include <stdio.h>
  181. Syntax Error
  182. EOF
  183. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  184. if test -z "$err"; then
  185.   :
  186. else
  187.   rm -rf conftest*
  188.   CPP=/lib/cpp
  189. fi
  190. rm -f conftest*
  191. fi
  192. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  193.  
  194. echo checking whether cross-compiling
  195. # If we cannot run a trivial program, we must be cross compiling.
  196. cat > conftest.c <<EOF
  197. #include "confdefs.h"
  198. main(){exit(0);}
  199. EOF
  200. eval $compile
  201. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  202.   :
  203. else
  204.   cross_compiling=1
  205. fi
  206. rm -fr conftest*
  207.  
  208. echo checking for function prototypes
  209. cat > conftest.c <<EOF
  210. #include "confdefs.h"
  211.  
  212. int testfunction (int arg1, int * arg2); /* check prototypes */
  213. struct methods_struct {        /* check method-pointer declarations */
  214.   int (*error_exit) (char *msgtext);
  215.   int (*trace_message) (char *msgtext);
  216.   int (*another_method) (void);
  217. };
  218. int testfunction (int arg1, int * arg2) /* check definitions */
  219. { return arg2[arg1]; }
  220. int test2function (void)    /* check void arg list */
  221. { return 0; }
  222.  
  223. int main() { exit(0); }
  224. int t() {   }
  225. EOF
  226. if eval $compile; then
  227.   rm -rf conftest*
  228.   
  229. {
  230. test -n "$verbose" && \
  231. echo "    defining" HAVE_PROTOTYPES to be empty
  232. echo "#define" HAVE_PROTOTYPES  >> confdefs.h
  233. DEFS="$DEFS -DHAVE_PROTOTYPES="
  234. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_PROTOTYPES\${SEDdB}HAVE_PROTOTYPES\${SEDdC}\${SEDdD}
  235. \${SEDuA}HAVE_PROTOTYPES\${SEDuB}HAVE_PROTOTYPES\${SEDuC}\${SEDuD}
  236. \${SEDeA}HAVE_PROTOTYPES\${SEDeB}HAVE_PROTOTYPES\${SEDeC}\${SEDeD}
  237. "
  238. }
  239.  
  240.  
  241. else
  242.   rm -rf conftest*
  243.   echo Your compiler does not seem to know about function prototypes.
  244. echo Perhaps it needs a special switch to enable ANSI C mode.
  245. echo If so, we recommend running configure like this:
  246. echo "   ./configure  CC='cc -switch'"
  247. echo where -switch is the proper switch.
  248.  
  249. fi
  250. rm -f conftest*
  251. echo checking for stddef.h
  252. cat > conftest.c <<EOF
  253. #include "confdefs.h"
  254. #include <stddef.h>
  255. EOF
  256. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  257. if test -z "$err"; then
  258.   rm -rf conftest*
  259.   
  260. {
  261. test -n "$verbose" && \
  262. echo "    defining" HAVE_STDDEF_H to be empty
  263. echo "#define" HAVE_STDDEF_H  >> confdefs.h
  264. DEFS="$DEFS -DHAVE_STDDEF_H="
  265. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_STDDEF_H\${SEDdB}HAVE_STDDEF_H\${SEDdC}\${SEDdD}
  266. \${SEDuA}HAVE_STDDEF_H\${SEDuB}HAVE_STDDEF_H\${SEDuC}\${SEDuD}
  267. \${SEDeA}HAVE_STDDEF_H\${SEDeB}HAVE_STDDEF_H\${SEDeC}\${SEDeD}
  268. "
  269. }
  270.  
  271.  
  272. fi
  273. rm -f conftest*
  274.  
  275. echo checking for stdlib.h
  276. cat > conftest.c <<EOF
  277. #include "confdefs.h"
  278. #include <stdlib.h>
  279. EOF
  280. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  281. if test -z "$err"; then
  282.   rm -rf conftest*
  283.   
  284. {
  285. test -n "$verbose" && \
  286. echo "    defining" HAVE_STDLIB_H to be empty
  287. echo "#define" HAVE_STDLIB_H  >> confdefs.h
  288. DEFS="$DEFS -DHAVE_STDLIB_H="
  289. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_STDLIB_H\${SEDdB}HAVE_STDLIB_H\${SEDdC}\${SEDdD}
  290. \${SEDuA}HAVE_STDLIB_H\${SEDuB}HAVE_STDLIB_H\${SEDuC}\${SEDuD}
  291. \${SEDeA}HAVE_STDLIB_H\${SEDeB}HAVE_STDLIB_H\${SEDeC}\${SEDeD}
  292. "
  293. }
  294.  
  295.  
  296. fi
  297. rm -f conftest*
  298.  
  299. echo checking for string.h
  300. cat > conftest.c <<EOF
  301. #include "confdefs.h"
  302. #include <string.h>
  303. EOF
  304. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  305. if test -z "$err"; then
  306.   :
  307. else
  308.   rm -rf conftest*
  309.   
  310. {
  311. test -n "$verbose" && \
  312. echo "    defining" NEED_BSD_STRINGS to be empty
  313. echo "#define" NEED_BSD_STRINGS  >> confdefs.h
  314. DEFS="$DEFS -DNEED_BSD_STRINGS="
  315. SEDDEFS="${SEDDEFS}\${SEDdA}NEED_BSD_STRINGS\${SEDdB}NEED_BSD_STRINGS\${SEDdC}\${SEDdD}
  316. \${SEDuA}NEED_BSD_STRINGS\${SEDuB}NEED_BSD_STRINGS\${SEDuC}\${SEDuD}
  317. \${SEDeA}NEED_BSD_STRINGS\${SEDeB}NEED_BSD_STRINGS\${SEDeC}\${SEDeD}
  318. "
  319. }
  320.  
  321. fi
  322. rm -f conftest*
  323.  
  324. echo checking for size_t
  325. cat > conftest.c <<EOF
  326. #include "confdefs.h"
  327.  
  328. #ifdef HAVE_STDDEF_H
  329. #include <stddef.h>
  330. #endif
  331. #ifdef HAVE_STDLIB_H
  332. #include <stdlib.h>
  333. #endif
  334. #include <stdio.h>
  335. #ifdef NEED_BSD_STRINGS
  336. #include <strings.h>
  337. #else
  338. #include <string.h>
  339. #endif
  340. typedef size_t my_size_t;
  341.  
  342. int main() { exit(0); }
  343. int t() {  my_size_t foovar;  }
  344. EOF
  345. if eval $compile; then
  346.   :
  347. else
  348.   rm -rf conftest*
  349.   echo checking for sys/types.h
  350. cat > conftest.c <<EOF
  351. #include "confdefs.h"
  352. #include <sys/types.h>
  353. EOF
  354. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  355. if test -z "$err"; then
  356.   rm -rf conftest*
  357.   
  358. {
  359. test -n "$verbose" && \
  360. echo "    defining" NEED_SYS_TYPES_H to be empty
  361. echo "#define" NEED_SYS_TYPES_H  >> confdefs.h
  362. DEFS="$DEFS -DNEED_SYS_TYPES_H="
  363. SEDDEFS="${SEDDEFS}\${SEDdA}NEED_SYS_TYPES_H\${SEDdB}NEED_SYS_TYPES_H\${SEDdC}\${SEDdD}
  364. \${SEDuA}NEED_SYS_TYPES_H\${SEDuB}NEED_SYS_TYPES_H\${SEDuC}\${SEDuD}
  365. \${SEDeA}NEED_SYS_TYPES_H\${SEDeB}NEED_SYS_TYPES_H\${SEDeC}\${SEDeD}
  366. "
  367. }
  368.  
  369.  
  370. else
  371.   rm -rf conftest*
  372.   echo Type size_t is not defined in any of the usual places.
  373. echo Try putting '"typedef unsigned int size_t;"' in jconfig.h.
  374.  
  375. fi
  376. rm -f conftest*
  377.  
  378. fi
  379. rm -f conftest*
  380. echo checking for unsigned char
  381. cat > conftest.c <<EOF
  382. #include "confdefs.h"
  383.  
  384. int main() { exit(0); }
  385. int t() {  unsigned char un_char;  }
  386. EOF
  387. if eval $compile; then
  388.   rm -rf conftest*
  389.   
  390. {
  391. test -n "$verbose" && \
  392. echo "    defining" HAVE_UNSIGNED_CHAR to be empty
  393. echo "#define" HAVE_UNSIGNED_CHAR  >> confdefs.h
  394. DEFS="$DEFS -DHAVE_UNSIGNED_CHAR="
  395. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNSIGNED_CHAR\${SEDdB}HAVE_UNSIGNED_CHAR\${SEDdC}\${SEDdD}
  396. \${SEDuA}HAVE_UNSIGNED_CHAR\${SEDuB}HAVE_UNSIGNED_CHAR\${SEDuC}\${SEDuD}
  397. \${SEDeA}HAVE_UNSIGNED_CHAR\${SEDeB}HAVE_UNSIGNED_CHAR\${SEDeC}\${SEDeD}
  398. "
  399. }
  400.  
  401.  
  402. fi
  403. rm -f conftest*
  404. echo checking for unsigned short
  405. cat > conftest.c <<EOF
  406. #include "confdefs.h"
  407.  
  408. int main() { exit(0); }
  409. int t() {  unsigned short un_short;  }
  410. EOF
  411. if eval $compile; then
  412.   rm -rf conftest*
  413.   
  414. {
  415. test -n "$verbose" && \
  416. echo "    defining" HAVE_UNSIGNED_SHORT to be empty
  417. echo "#define" HAVE_UNSIGNED_SHORT  >> confdefs.h
  418. DEFS="$DEFS -DHAVE_UNSIGNED_SHORT="
  419. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNSIGNED_SHORT\${SEDdB}HAVE_UNSIGNED_SHORT\${SEDdC}\${SEDdD}
  420. \${SEDuA}HAVE_UNSIGNED_SHORT\${SEDuB}HAVE_UNSIGNED_SHORT\${SEDuC}\${SEDuD}
  421. \${SEDeA}HAVE_UNSIGNED_SHORT\${SEDeB}HAVE_UNSIGNED_SHORT\${SEDeC}\${SEDeD}
  422. "
  423. }
  424.  
  425.  
  426. fi
  427. rm -f conftest*
  428. echo checking for type void
  429. cat > conftest.c <<EOF
  430. #include "confdefs.h"
  431.  
  432. /* Caution: a C++ compiler will insist on valid prototypes */
  433. typedef void * void_ptr;    /* check void * */
  434. #ifdef HAVE_PROTOTYPES        /* check ptr to function returning void */
  435. typedef void (*void_func) (int a, int b);
  436. #else
  437. typedef void (*void_func) ();
  438. #endif
  439.  
  440. #ifdef HAVE_PROTOTYPES        /* check void function result */
  441. void test3function (void_ptr arg1, void_func arg2)
  442. #else
  443. void test3function (arg1, arg2)
  444.      void_ptr arg1;
  445.      void_func arg2;
  446. #endif
  447. {
  448.   char * locptr = (char *) arg1; /* check casting to and from void * */
  449.   arg1 = (void *) locptr;
  450.   (*arg2) (1, 2);        /* check call of fcn returning void */
  451. }
  452.  
  453. int main() { exit(0); }
  454. int t() {   }
  455. EOF
  456. if eval $compile; then
  457.   :
  458. else
  459.   rm -rf conftest*
  460.   
  461. {
  462. test -n "$verbose" && \
  463. echo "    defining" void to be char
  464. echo "#define" void char >> confdefs.h
  465. DEFS="$DEFS -Dvoid=char"
  466. SEDDEFS="${SEDDEFS}\${SEDdA}void\${SEDdB}void\${SEDdC}char\${SEDdD}
  467. \${SEDuA}void\${SEDuB}void\${SEDuC}char\${SEDuD}
  468. \${SEDeA}void\${SEDeB}void\${SEDeC}char\${SEDeD}
  469. "
  470. }
  471.  
  472. fi
  473. rm -f conftest*
  474. prog='/* Ultrix mips cc rejects this.  */
  475. typedef int charset[2]; const charset x;
  476. /* SunOS 4.1.1 cc rejects this.  */
  477. char const *const *ccp;
  478. char **p;
  479. /* AIX XL C 1.02.0.0 rejects this.
  480.    It does not let you subtract one const X* pointer from another in an arm
  481.    of an if-expression whose if-part is not a constant expression */
  482. const char *g = "string";
  483. ccp = &g + (g ? g-g : 0);
  484. /* HPUX 7.0 cc rejects these. */
  485. ++ccp;
  486. p = (char**) ccp;
  487. ccp = (char const *const *) p;
  488. { /* SCO 3.2v4 cc rejects this.  */
  489.   char *t;
  490.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  491.  
  492.   *t++ = 0;
  493. }
  494. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  495.   int x[] = {25,17};
  496.   const int *foo = &x[0];
  497.   ++foo;
  498. }
  499. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  500.   typedef const int *iptr;
  501.   iptr p = 0;
  502.   ++p;
  503. }
  504. { /* AIX XL C 1.02.0.0 rejects this saying
  505.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  506.   struct s { int j; const int *ap[3]; };
  507.   struct s *b; b->j = 5;
  508. }
  509. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  510.   const int foo = 10;
  511. }'
  512. echo checking for lack of working const
  513. cat > conftest.c <<EOF
  514. #include "confdefs.h"
  515.  
  516. int main() { exit(0); }
  517. int t() { $prog }
  518. EOF
  519. if eval $compile; then
  520.   :
  521. else
  522.   rm -rf conftest*
  523.   
  524. {
  525. test -n "$verbose" && \
  526. echo "    defining" const to be empty
  527. echo "#define" const  >> confdefs.h
  528. DEFS="$DEFS -Dconst="
  529. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  530. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  531. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  532. "
  533. }
  534.  
  535. fi
  536. rm -f conftest*
  537.  
  538. echo checking for inline
  539. cat > conftest.c <<EOF
  540. #include "confdefs.h"
  541.  
  542. int main() { exit(0); }
  543. int t() { } inline int foo() { return 0; }
  544. int bar() { return foo(); }
  545. EOF
  546. if eval $compile; then
  547.   rm -rf conftest*
  548.   
  549. {
  550. test -n "$verbose" && \
  551. echo "    defining" INLINE to be inline
  552. echo "#define" INLINE inline >> confdefs.h
  553. DEFS="$DEFS -DINLINE=inline"
  554. SEDDEFS="${SEDDEFS}\${SEDdA}INLINE\${SEDdB}INLINE\${SEDdC}inline\${SEDdD}
  555. \${SEDuA}INLINE\${SEDuB}INLINE\${SEDuC}inline\${SEDuD}
  556. \${SEDeA}INLINE\${SEDeB}INLINE\${SEDeC}inline\${SEDeD}
  557. "
  558. }
  559.  
  560.  
  561. else
  562.   rm -rf conftest*
  563.   cat > conftest.c <<EOF
  564. #include "confdefs.h"
  565.  
  566. int main() { exit(0); }
  567. int t() { } __inline__ int foo() { return 0; }
  568. int bar() { return foo(); }
  569. EOF
  570. if eval $compile; then
  571.   rm -rf conftest*
  572.   
  573. {
  574. test -n "$verbose" && \
  575. echo "    defining" INLINE to be __inline__
  576. echo "#define" INLINE __inline__ >> confdefs.h
  577. DEFS="$DEFS -DINLINE=__inline__"
  578. SEDDEFS="${SEDDEFS}\${SEDdA}INLINE\${SEDdB}INLINE\${SEDdC}__inline__\${SEDdD}
  579. \${SEDuA}INLINE\${SEDuB}INLINE\${SEDuC}__inline__\${SEDuD}
  580. \${SEDeA}INLINE\${SEDeB}INLINE\${SEDeC}__inline__\${SEDeD}
  581. "
  582. }
  583.  
  584.  
  585. else
  586.   rm -rf conftest*
  587.   cat > conftest.c <<EOF
  588. #include "confdefs.h"
  589.  
  590. int main() { exit(0); }
  591. int t() { } __inline int foo() { return 0; }
  592. int bar() { return foo(); }
  593. EOF
  594. if eval $compile; then
  595.   rm -rf conftest*
  596.   
  597. {
  598. test -n "$verbose" && \
  599. echo "    defining" INLINE to be __inline
  600. echo "#define" INLINE __inline >> confdefs.h
  601. DEFS="$DEFS -DINLINE=__inline"
  602. SEDDEFS="${SEDDEFS}\${SEDdA}INLINE\${SEDdB}INLINE\${SEDdC}__inline\${SEDdD}
  603. \${SEDuA}INLINE\${SEDuB}INLINE\${SEDuC}__inline\${SEDuD}
  604. \${SEDeA}INLINE\${SEDeB}INLINE\${SEDeC}__inline\${SEDeD}
  605. "
  606. }
  607.  
  608.  
  609. else
  610.   rm -rf conftest*
  611.   
  612. {
  613. test -n "$verbose" && \
  614. echo "    defining" INLINE to be empty
  615. echo "#define" INLINE  >> confdefs.h
  616. DEFS="$DEFS -DINLINE="
  617. SEDDEFS="${SEDDEFS}\${SEDdA}INLINE\${SEDdB}INLINE\${SEDdC}\${SEDdD}
  618. \${SEDuA}INLINE\${SEDuB}INLINE\${SEDuC}\${SEDuD}
  619. \${SEDeA}INLINE\${SEDeB}INLINE\${SEDeC}\${SEDeD}
  620. "
  621. }
  622.  
  623. fi
  624. rm -f conftest*
  625.  
  626. fi
  627. rm -f conftest*
  628.  
  629. fi
  630. rm -f conftest*
  631. echo checking for broken incomplete types
  632. cat > conftest.c <<EOF
  633. #include "confdefs.h"
  634.  typedef struct undefined_structure * undef_struct_ptr; 
  635. int main() { exit(0); }
  636. int t() {  }
  637. EOF
  638. if eval $compile; then
  639.   :
  640. else
  641.   rm -rf conftest*
  642.   
  643. {
  644. test -n "$verbose" && \
  645. echo "    defining" INCOMPLETE_TYPES_BROKEN to be empty
  646. echo "#define" INCOMPLETE_TYPES_BROKEN  >> confdefs.h
  647. DEFS="$DEFS -DINCOMPLETE_TYPES_BROKEN="
  648. SEDDEFS="${SEDDEFS}\${SEDdA}INCOMPLETE_TYPES_BROKEN\${SEDdB}INCOMPLETE_TYPES_BROKEN\${SEDdC}\${SEDdD}
  649. \${SEDuA}INCOMPLETE_TYPES_BROKEN\${SEDuB}INCOMPLETE_TYPES_BROKEN\${SEDuC}\${SEDuD}
  650. \${SEDeA}INCOMPLETE_TYPES_BROKEN\${SEDeB}INCOMPLETE_TYPES_BROKEN\${SEDeC}\${SEDeD}
  651. "
  652. }
  653.  
  654. fi
  655. rm -f conftest*
  656. echo checking for short external names
  657. cat > conftest.c <<EOF
  658. #include "confdefs.h"
  659.  
  660. int possibly_duplicate_function () { return 0; }
  661. int possibly_dupli_function () { return 1; }
  662.  
  663. int main() { exit(0); }
  664. int t() {   }
  665. EOF
  666. if eval $compile; then
  667.   :
  668. else
  669.   rm -rf conftest*
  670.   
  671. {
  672. test -n "$verbose" && \
  673. echo "    defining" NEED_SHORT_EXTERNAL_NAMES to be empty
  674. echo "#define" NEED_SHORT_EXTERNAL_NAMES  >> confdefs.h
  675. DEFS="$DEFS -DNEED_SHORT_EXTERNAL_NAMES="
  676. SEDDEFS="${SEDDEFS}\${SEDdA}NEED_SHORT_EXTERNAL_NAMES\${SEDdB}NEED_SHORT_EXTERNAL_NAMES\${SEDdC}\${SEDdD}
  677. \${SEDuA}NEED_SHORT_EXTERNAL_NAMES\${SEDuB}NEED_SHORT_EXTERNAL_NAMES\${SEDuC}\${SEDuD}
  678. \${SEDeA}NEED_SHORT_EXTERNAL_NAMES\${SEDeB}NEED_SHORT_EXTERNAL_NAMES\${SEDeC}\${SEDeD}
  679. "
  680. }
  681.  
  682. fi
  683. rm -f conftest*
  684.  
  685. echo checking to see if char is signed
  686. if test -n "$cross_compiling"
  687. then
  688.   echo Assuming that char is signed on target machine.
  689. echo If it is unsigned, this will be a little bit inefficient.
  690.  
  691. else
  692. cat > conftest.c <<EOF
  693. #include "confdefs.h"
  694.  
  695. #ifdef HAVE_PROTOTYPES
  696. int is_char_signed (int arg)
  697. #else
  698. int is_char_signed (arg)
  699.      int arg;
  700. #endif
  701. {
  702.   if (arg == 189) {        /* expected result for unsigned char */
  703.     return 0;            /* type char is unsigned */
  704.   }
  705.   else if (arg != -67) {    /* expected result for signed char */
  706.     printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n");
  707.     printf("I fear the JPEG software will not work at all.\n\n");
  708.   }
  709.   return 1;            /* assume char is signed otherwise */
  710. }
  711. char signed_char_check = (char) (-67);
  712. main() {
  713.   exit(is_char_signed((int) signed_char_check));
  714. }
  715. EOF
  716. eval $compile
  717. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  718.   
  719. {
  720. test -n "$verbose" && \
  721. echo "    defining" CHAR_IS_UNSIGNED to be empty
  722. echo "#define" CHAR_IS_UNSIGNED  >> confdefs.h
  723. DEFS="$DEFS -DCHAR_IS_UNSIGNED="
  724. SEDDEFS="${SEDDEFS}\${SEDdA}CHAR_IS_UNSIGNED\${SEDdB}CHAR_IS_UNSIGNED\${SEDdC}\${SEDdD}
  725. \${SEDuA}CHAR_IS_UNSIGNED\${SEDuB}CHAR_IS_UNSIGNED\${SEDuC}\${SEDuD}
  726. \${SEDeA}CHAR_IS_UNSIGNED\${SEDeB}CHAR_IS_UNSIGNED\${SEDeC}\${SEDeD}
  727. "
  728. }
  729.  
  730.  
  731. fi
  732. fi
  733. rm -fr conftest*
  734. echo checking to see if right shift is signed
  735. if test -n "$cross_compiling"
  736. then
  737.   echo Assuming that right shift is signed on target machine.
  738.  
  739. else
  740. cat > conftest.c <<EOF
  741. #include "confdefs.h"
  742.  
  743. #ifdef HAVE_PROTOTYPES
  744. int is_shifting_signed (long arg)
  745. #else
  746. int is_shifting_signed (arg)
  747.      long arg;
  748. #endif
  749. /* See whether right-shift on a long is signed or not. */
  750. {
  751.   long res = arg >> 4;
  752.  
  753.   if (res == -0x7F7E80CL) {    /* expected result for signed shift */
  754.     return 1;            /* right shift is signed */
  755.   }
  756.   /* see if unsigned-shift hack will fix it. */
  757.   /* we can't just test exact value since it depends on width of long... */
  758.   res |= (~0L) << (32-4);
  759.   if (res == -0x7F7E80CL) {    /* expected result now? */
  760.     return 0;            /* right shift is unsigned */
  761.   }
  762.   printf("Right shift isn't acting as I expect it to.\n");
  763.   printf("I fear the JPEG software will not work at all.\n\n");
  764.   return 0;            /* try it with unsigned anyway */
  765. }
  766. main() {
  767.   exit(is_shifting_signed(-0x7F7E80B1L));
  768. }
  769. EOF
  770. eval $compile
  771. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  772.   
  773. {
  774. test -n "$verbose" && \
  775. echo "    defining" RIGHT_SHIFT_IS_UNSIGNED to be empty
  776. echo "#define" RIGHT_SHIFT_IS_UNSIGNED  >> confdefs.h
  777. DEFS="$DEFS -DRIGHT_SHIFT_IS_UNSIGNED="
  778. SEDDEFS="${SEDDEFS}\${SEDdA}RIGHT_SHIFT_IS_UNSIGNED\${SEDdB}RIGHT_SHIFT_IS_UNSIGNED\${SEDdC}\${SEDdD}
  779. \${SEDuA}RIGHT_SHIFT_IS_UNSIGNED\${SEDuB}RIGHT_SHIFT_IS_UNSIGNED\${SEDuC}\${SEDuD}
  780. \${SEDeA}RIGHT_SHIFT_IS_UNSIGNED\${SEDeB}RIGHT_SHIFT_IS_UNSIGNED\${SEDeC}\${SEDeD}
  781. "
  782. }
  783.  
  784.  
  785. fi
  786. fi
  787. rm -fr conftest*
  788. echo checking to see if fopen accepts b spec
  789. if test -n "$cross_compiling"
  790. then
  791.   echo Assuming that it does.
  792.  
  793. else
  794. cat > conftest.c <<EOF
  795. #include "confdefs.h"
  796.  
  797. #include <stdio.h>
  798. main() {
  799.   if (fopen("conftestdata", "wb") != NULL)
  800.     exit(0);
  801.   exit(1);
  802. }
  803. EOF
  804. eval $compile
  805. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  806.   :
  807. else
  808.   
  809. {
  810. test -n "$verbose" && \
  811. echo "    defining" DONT_USE_B_MODE to be empty
  812. echo "#define" DONT_USE_B_MODE  >> confdefs.h
  813. DEFS="$DEFS -DDONT_USE_B_MODE="
  814. SEDDEFS="${SEDDEFS}\${SEDdA}DONT_USE_B_MODE\${SEDdB}DONT_USE_B_MODE\${SEDdC}\${SEDdD}
  815. \${SEDuA}DONT_USE_B_MODE\${SEDuB}DONT_USE_B_MODE\${SEDuC}\${SEDuD}
  816. \${SEDeA}DONT_USE_B_MODE\${SEDeB}DONT_USE_B_MODE\${SEDeC}\${SEDeD}
  817. "
  818. }
  819.  
  820. fi
  821. fi
  822. rm -fr conftest*
  823. # Make sure to not get the incompatible SysV /etc/install and
  824. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  825. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  826. # or the AFS install, which mishandles nonexistent args, or
  827. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  828. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  829. # anyway.  Sigh.
  830. if test "z${INSTALL}" = "z" ; then
  831.   echo checking for install
  832.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  833.   for dir in $PATH; do
  834.     test -z "$dir" && dir=.
  835.     case $dir in
  836.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  837.     *)
  838.       if test -f $dir/installbsd; then
  839.     INSTALL="$dir/installbsd -c" # OSF1
  840.     INSTALL_PROGRAM='$(INSTALL)'
  841.     INSTALL_DATA='$(INSTALL) -m 644'
  842.     break
  843.       fi
  844.       if test -f $dir/install; then
  845.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  846.       : # AIX
  847.     else
  848.       INSTALL="$dir/install -c"
  849.       INSTALL_PROGRAM='$(INSTALL)'
  850.       INSTALL_DATA='$(INSTALL) -m 644'
  851.       break
  852.     fi
  853.       fi
  854.       ;;
  855.     esac
  856.   done
  857.   IFS="$saveifs"
  858. fi
  859. INSTALL=${INSTALL-cp}
  860. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  861. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  862. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  863. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  864. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  865.  
  866. if test -z "$RANLIB"; then
  867.   # Extract the first word of `ranlib', so it can be a program name with args.
  868.   set dummy ranlib; word=$2
  869.   echo checking for $word
  870.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  871.   for dir in $PATH; do
  872.     test -z "$dir" && dir=.
  873.     if test -f $dir/$word; then
  874.       RANLIB="ranlib"
  875.       break
  876.     fi
  877.   done
  878.   IFS="$saveifs"
  879. fi
  880. test -z "$RANLIB" && RANLIB=":"
  881. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  882.  
  883. # check whether --with-maxmem was given
  884. withval="$with_maxmem"
  885. if test -n "$withval"; then
  886.   DEFAULTMAXMEM=`expr $withval \* 1048576`
  887.  
  888. {
  889. test -n "$verbose" && \
  890. echo "    defining" DEFAULT_MAX_MEM to be ${DEFAULTMAXMEM}
  891. echo "#define" DEFAULT_MAX_MEM ${DEFAULTMAXMEM} >> confdefs.h
  892. DEFS="$DEFS -DDEFAULT_MAX_MEM=${DEFAULTMAXMEM}"
  893. SEDDEFS="${SEDDEFS}\${SEDdA}DEFAULT_MAX_MEM\${SEDdB}DEFAULT_MAX_MEM\${SEDdC}${DEFAULTMAXMEM}\${SEDdD}
  894. \${SEDuA}DEFAULT_MAX_MEM\${SEDuB}DEFAULT_MAX_MEM\${SEDuC}${DEFAULTMAXMEM}\${SEDuD}
  895. \${SEDeA}DEFAULT_MAX_MEM\${SEDeB}DEFAULT_MAX_MEM\${SEDeC}${DEFAULTMAXMEM}\${SEDeD}
  896. "
  897. }
  898.  
  899. echo checking for 'tmpfile()'
  900. cat > conftest.c <<EOF
  901. #include "confdefs.h"
  902. #include <stdio.h>
  903. int main() { exit(0); }
  904. int t() {  FILE * tfile = tmpfile();  }
  905. EOF
  906. if eval $compile; then
  907.   rm -rf conftest*
  908.   MEMORYMGR="jmemansi.o"
  909.  
  910. else
  911.   rm -rf conftest*
  912.   MEMORYMGR="jmemname.o"
  913.  
  914. {
  915. test -n "$verbose" && \
  916. echo "    defining" NEED_SIGNAL_CATCHER to be empty
  917. echo "#define" NEED_SIGNAL_CATCHER  >> confdefs.h
  918. DEFS="$DEFS -DNEED_SIGNAL_CATCHER="
  919. SEDDEFS="${SEDDEFS}\${SEDdA}NEED_SIGNAL_CATCHER\${SEDdB}NEED_SIGNAL_CATCHER\${SEDdC}\${SEDdD}
  920. \${SEDuA}NEED_SIGNAL_CATCHER\${SEDuB}NEED_SIGNAL_CATCHER\${SEDuC}\${SEDuD}
  921. \${SEDeA}NEED_SIGNAL_CATCHER\${SEDeB}NEED_SIGNAL_CATCHER\${SEDeC}\${SEDeD}
  922. "
  923. }
  924. echo checking for 'mktemp()'
  925. cat > conftest.c <<EOF
  926. #include "confdefs.h"
  927.  
  928. int main() { exit(0); }
  929. int t() {  char fname[80]; mktemp(fname);  }
  930. EOF
  931. if eval $compile; then
  932.   :
  933. else
  934.   rm -rf conftest*
  935.   
  936. {
  937. test -n "$verbose" && \
  938. echo "    defining" NO_MKTEMP to be empty
  939. echo "#define" NO_MKTEMP  >> confdefs.h
  940. DEFS="$DEFS -DNO_MKTEMP="
  941. SEDDEFS="${SEDDEFS}\${SEDdA}NO_MKTEMP\${SEDdB}NO_MKTEMP\${SEDdC}\${SEDdD}
  942. \${SEDuA}NO_MKTEMP\${SEDuB}NO_MKTEMP\${SEDuC}\${SEDuD}
  943. \${SEDeA}NO_MKTEMP\${SEDeB}NO_MKTEMP\${SEDeC}\${SEDeD}
  944. "
  945. }
  946.  
  947. fi
  948. rm -f conftest*
  949.  
  950. fi
  951. rm -f conftest*
  952.  
  953. else
  954.   MEMORYMGR="jmemnobs.o"
  955. fi
  956.  
  957. # Prepare to massage makefile.auto correctly.
  958. case "$DEFS" in
  959.   *HAVE_PROTOTYPES*)
  960.     ANSI2KNR=""
  961.     ISANSICOM="# "
  962.     ;;
  963.   *)
  964.     ANSI2KNR="ansi2knr"
  965.     ISANSICOM=""
  966.     ;;
  967. esac
  968. case "$DEFS" in
  969.   *NEED_BSD_STRINGS*)
  970.     ANSI2KNRFLAGS="-DBSD"
  971.     ;;
  972.   *)
  973.     ANSI2KNRFLAGS=""
  974.     ;;
  975. esac
  976. # Set default prefixes.
  977. if test -n "$prefix"; then
  978.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  979.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  980. fi
  981. if test -n "$exec_prefix"; then
  982.   prsub="$prsub
  983. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  984. fi
  985. # Quote sed substitution magic chars in DEFS.
  986. cat >conftest.def <<EOF
  987. $DEFS
  988. EOF
  989. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  990. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  991. rm -f conftest.def
  992. # Substitute for predefined variables.
  993.  
  994. trap 'rm -f config.status; exit 1' 1 3 15
  995. echo creating config.status
  996. rm -f config.status
  997. cat > config.status <<EOF
  998. #!/bin/sh
  999. # Generated automatically by configure.
  1000. # Run this file to recreate the current configuration.
  1001. # This directory was configured as follows,
  1002. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1003. #
  1004. # $0 $configure_args
  1005.  
  1006. for arg
  1007. do
  1008.   case "\$arg" in
  1009.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1010.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  1011.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  1012.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  1013.   esac
  1014. done
  1015.  
  1016. trap 'rm -fr Makefile jconfig.h conftest*; exit 1' 1 3 15
  1017. CC='$CC'
  1018. CPP='$CPP'
  1019. INSTALL='$INSTALL'
  1020. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  1021. INSTALL_DATA='$INSTALL_DATA'
  1022. RANLIB='$RANLIB'
  1023. MEMORYMGR='$MEMORYMGR'
  1024. ANSI2KNR='$ANSI2KNR'
  1025. ISANSICOM='$ISANSICOM'
  1026. ANSI2KNRFLAGS='$ANSI2KNRFLAGS'
  1027. LIBS='$LIBS'
  1028. srcdir='$srcdir'
  1029. prefix='$prefix'
  1030. exec_prefix='$exec_prefix'
  1031. prsub='$prsub'
  1032. extrasub='$extrasub'
  1033. EOF
  1034. cat >> config.status <<\EOF
  1035.  
  1036. top_srcdir=$srcdir
  1037.  
  1038. CONFIG_FILES=${CONFIG_FILES-"Makefile"}
  1039. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  1040.   srcdir=$top_srcdir
  1041.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1042.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  1043.   if test "$dir" != "$file"; then
  1044.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  1045.     test ! -d $dir && mkdir $dir
  1046.   fi
  1047.   echo creating $file
  1048.   rm -f $file
  1049.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.auto by configure." > $file
  1050.   sed -e "
  1051. $prsub
  1052. $extrasub
  1053. s%@CC@%$CC%g
  1054. s%@CPP@%$CPP%g
  1055. s%@INSTALL@%$INSTALL%g
  1056. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1057. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1058. s%@RANLIB@%$RANLIB%g
  1059. s%@MEMORYMGR@%$MEMORYMGR%g
  1060. s%@ANSI2KNR@%$ANSI2KNR%g
  1061. s%@ISANSICOM@%$ISANSICOM%g
  1062. s%@ANSI2KNRFLAGS@%$ANSI2KNRFLAGS%g
  1063. s%@LIBS@%$LIBS%g
  1064. s%@srcdir@%$srcdir%g
  1065. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/makefile.auto >> $file
  1066. fi; done
  1067.  
  1068. CONFIG_HEADERS=${CONFIG_HEADERS-"jconfig.h"}
  1069. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  1070. echo creating $file
  1071.  
  1072. # These sed commands are put into SEDDEFS when defining a macro.
  1073. # They are broken into pieces to make the sed script easier to manage.
  1074. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  1075. # is the cpp macro being defined and VALUE is the value it is being given.
  1076. # Each defining turns into a single global substitution command.
  1077. #
  1078. # SEDd sets the value in "#define NAME VALUE" lines.
  1079. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  1080. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  1081. SEDdC='\3'
  1082. SEDdD='@g'
  1083. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  1084. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1085. SEDuB='\([     ]\)@\1#\2define\3'
  1086. SEDuC=' '
  1087. SEDuD='\4@g'
  1088. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  1089. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1090. SEDeB='$@\1#\2define\3'
  1091. SEDeC=' '
  1092. SEDeD='@g'
  1093. rm -f conftest.sed
  1094. EOF
  1095. # Turn off quoting long enough to insert the sed commands.
  1096. rm -f conftest.sh
  1097. cat > conftest.sh <<EOF
  1098. $SEDDEFS
  1099. EOF
  1100.  
  1101. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  1102. # on the size of here documents.
  1103.  
  1104. # Maximum number of lines to put in a single here document.
  1105. maxshlines=9
  1106.  
  1107. while :
  1108. do
  1109.   # wc gives bogus results for an empty file on some systems.
  1110.   lines=`grep -c . conftest.sh`
  1111.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1112.   rm -f conftest.s1 conftest.s2
  1113.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  1114.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  1115.   # Write a limited-size here document to append to conftest.sed.
  1116.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  1117.   cat conftest.s1 >> config.status
  1118.   echo 'CONFEOF' >> config.status
  1119.   rm -f conftest.s1 conftest.sh
  1120.   mv conftest.s2 conftest.sh
  1121. done
  1122. rm -f conftest.sh
  1123.  
  1124. # Now back to your regularly scheduled config.status.
  1125. cat >> config.status <<\EOF
  1126. # This sed command replaces #undef's with comments.  This is necessary, for
  1127. # example, in the case of _POSIX_SOURCE, which is predefined and required
  1128. # on some systems where configure will not decide to define it in
  1129. # jconfig.h.
  1130. cat >> conftest.sed <<\CONFEOF
  1131. CONFEOF
  1132. rm -f conftest.h
  1133. # Break up the sed commands because old seds have small limits.
  1134. maxsedlines=20
  1135. cp $top_srcdir/jconfig.auto conftest.h1
  1136. while :
  1137. do
  1138.   lines=`grep -c . conftest.sed`
  1139.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1140.   rm -f conftest.s1 conftest.s2 conftest.h2
  1141.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  1142.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  1143.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  1144.   rm -f conftest.s1 conftest.h1 conftest.sed
  1145.   mv conftest.h2 conftest.h1
  1146.   mv conftest.s2 conftest.sed
  1147. done
  1148. rm -f conftest.sed conftest.h
  1149. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  1150. cat conftest.h1 >> conftest.h
  1151. rm -f conftest.h1
  1152. if cmp -s $file conftest.h 2>/dev/null; then
  1153.   # The file exists and we would not be changing it.
  1154.   echo "$file is unchanged"
  1155.   rm -f conftest.h
  1156. else
  1157.   rm -f $file
  1158.   mv conftest.h $file
  1159. fi
  1160. fi; done
  1161.  
  1162.  
  1163.  
  1164. exit 0
  1165. EOF
  1166. chmod +x config.status
  1167. ${CONFIG_SHELL-/bin/sh} config.status
  1168.  
  1169.